home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / config / i386-emul / stackswap.s < prev    next >
Text File  |  1996-10-24  |  2KB  |  95 lines

  1. #    (C) 1995-96 AROS - The Amiga Replacement OS
  2. #    $Id: stackswap.s,v 1.7 1996/10/24 15:51:12 aros Exp $
  3. #    $Log: stackswap.s,v $
  4. #    Revision 1.7  1996/10/24 15:51:12  aros
  5. #    Use the official AROS macros over the __AROS versions.
  6. #
  7. #    Revision 1.6  1996/10/23 08:04:26  aros
  8. #    Use generated offsets which makes porting much easier
  9. #
  10. #    Revision 1.5  1996/09/11 16:54:29    digulla
  11. #    Always use __AROS_SLIB_ENTRY() to access shared external symbols, because
  12. #    some systems name an external symbol "x" as "_x" and others as "x".
  13. #    (The problem arises with assembler symbols which might differ)
  14. #
  15. #    Revision 1.4  1996/08/23 16:49:22    digulla
  16. #    With some systems, .align 16 aligns to 64K instead of 16bytes. Therefore
  17. #    I replaced it with .balign which does what we want.
  18. #
  19. #    Revision 1.3  1996/08/13 14:03:20    digulla
  20. #    Added standard headers
  21. #
  22. #    Revision 1.2  1996/08/01 17:41:20    digulla
  23. #    Added standard header for all files
  24. #
  25. #    Desc:
  26. #    Lang:
  27.  
  28. #*****************************************************************************
  29. #
  30. #   NAME
  31. #    AROS_LH0(void, StackSwap,
  32. #
  33. #   LOCATION
  34. #    struct ExecBase *, SysBase, 122, Exec)
  35. #
  36. #   FUNCTION
  37. #
  38. #   INPUTS
  39. #
  40. #   RESULT
  41. #
  42. #   NOTES
  43. #
  44. #   EXAMPLE
  45. #
  46. #   BUGS
  47. #
  48. #   SEE ALSO
  49. #
  50. #   INTERNALS
  51. #
  52. #   HISTORY
  53. #
  54. #******************************************************************************
  55.  
  56.     .include "machine.i"
  57.  
  58.     .text
  59.     .balign 16
  60.     .globl    _Exec_StackSwap
  61.     .type    _Exec_StackSwap,@function
  62. _Exec_StackSwap:
  63.     movl 4(%esp),%edx
  64.     movl 8(%edx),%ecx
  65.     popl %eax
  66.     movl %eax,-12(%ecx)
  67.     popl %eax
  68.     movl %eax,-8(%ecx)
  69.     movl (%esp),%eax
  70.     movl %eax,-4(%ecx)
  71.     addl $-12,%ecx
  72.     leal Disable(%eax),%eax
  73.     call *%eax
  74.     popl %eax
  75.     movl %esp,8(%edx)
  76.     movl %ecx,%esp
  77.     movl ThisTask(%eax),%ecx
  78.     leal tc_SPLower(%ecx),%ecx
  79.     push %ebx
  80.     movl (%edx),%eax
  81.     movl (%ecx),%ebx
  82.     movl %eax,(%ecx)
  83.     movl %ebx,(%edx)
  84.     movl 4(%edx),%eax
  85.     movl 4(%ecx),%ebx
  86.     movl %eax,4(%ecx)
  87.     movl %ebx,4(%edx)
  88.     popl %ebx
  89.     movl 8(%esp),%eax
  90.     pushl %eax
  91.     leal Enable(%eax),%eax
  92.     call *%eax
  93.     addl $4,%esp
  94.     ret
  95.